<nz-space [nzSize]="theme.space">
  <ng-container *ngFor="let group of buttonsConfig">
    <ng-container *ngIf="group.visable">
      <nz-button-group *nzSpaceItem [nzSize]="theme.size">
        <ng-container *ngFor="let button of group.buttonGroup">
          <button
            nz-button
            [disabled]="!button?.fn || !button.enabled"
            *ngIf="!button.childrens?.length && button.visable"
            (click)="button.fn()"
          >
            {{ button.name }}
          </button>
          <button
            nz-button
            nz-dropdown
            [nzDropdownMenu]="menuChildren"
            *ngIf="button.childrens?.length && button.visable"
          >
            {{ button.name }}
            <i nz-icon nzType="down"></i>
            <nz-dropdown-menu #menuChildren="nzDropdownMenu">
              <ul nz-menu>
                <li nz-menu-item *ngFor="let child of button.childrens" (click)="child.fn()">{{ child.name }}</li>
              </ul>
            </nz-dropdown-menu>
          </button>
        </ng-container>
      </nz-button-group>
    </ng-container>
  </ng-container>
</nz-space>
